import config from '@/utils/config'
import { generateRequest } from '@/utils/request'
const { apiUrlPrefix } = config

/** 商品列表 */
export const commodityListApi = generateRequest(`${apiUrlPrefix}/pcs/commodity/list`)

/** 商品上架 */
export const onShelvesCommodityApi = generateRequest(`${apiUrlPrefix}/pcs/commodity/published?id={id}`, 'put')

/** 商品下架 */
export const offShelvesCommodityApi = generateRequest(`${apiUrlPrefix}/pcs/commodity/unPublished?id={id}`, 'put')

/** 商品修改 */
export const updateCommodityApi = generateRequest(`${apiUrlPrefix}/pcs/commodity/update`, 'put')

/** 新增商品 */
export const createCommodityApi = generateRequest(`${apiUrlPrefix}/pcs/commodity/save`)

/** 商品删除 */
export const deleteCommodityApi = generateRequest(`${apiUrlPrefix}/pcs/commodity/delete`, 'delete')
